package com.itheima.map;

import java.util.HashMap;
import java.util.Map;

public class Demo02 {

    public static void main(String[] args) {
        Map<String,String> map= new HashMap<>();
        map.put("马蓉","宝强");
        map.put("马蓉","宋喆");
        map.put("小美","宝强");
        map.put("小璐","乃亮");
        map.put("小璐","PGone");
        map.put("anglebaby","小明");

        System.out.println(map);

        String s = map.remove("anglebaby");
        System.out.println(s);
        System.out.println(map);

        System.out.println(map.containsKey("anglebaby"));
        System.out.println(map.containsKey("马蓉"));

        System.out.println(map.containsValue("宝强"));
        System.out.println(map.containsValue("小明"));
        System.out.println("-----------------");
        System.out.println(map.size());
        System.out.println("-----------------");
        System.out.println(map.isEmpty());
        map.clear();
        System.out.println(map.isEmpty());
    }
}
